package com.nf.service;

import com.nf.dao.UserDao;
import com.nf.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Scope("prototype")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Transactional(readOnly = true)
    public List<User> getAllUser() {
        List<User> userList = userDao.getAllUser();
        for(User user:userList){
            user.setAddress(  user.getAddress() +"(from win)"  );
        }
        //没有其他业务逻辑，可以保留为空
        return userList;
    }
}
